<#include "header.htm"/>
<#import "../macros/pagination.ftl" as pagination/>
	<style type="text/css">@import url( ${contextPath}/templates/${templateName}/styles/custom.css?${startupTime} );</style>
<script type="text/javascript">
<!--
function confirmDelete(id)
{
	if (confirm("${I18n.getMessage("Bookmarks.reallyDelete")}")) {
		document.location = "${contextPath}/bookmarks/delete/" + id + "${extension}";
	}
}
<#include "js/utils.js"/>

-->
</script>

<h2>
   <a href="${JForumContext.encodeURL("/bookmarks/list/${user.id}")}">${I18n.getMessage("Bookmarks.for")} ${user.username}</a>
</h2>





<table cellspacing="1" cellpadding="3" width="100%" border="0">
	<#assign owner = loggedUserId == user.id/>  
	<tr>
	  <th class="thtop" nowrap="nowrap">&nbsp;${I18n.getMessage("Bookmarks.title")}&nbsp;</th>
	  <th class="thtop" nowrap="nowrap">&nbsp;${I18n.getMessage("Bookmarks.description")}&nbsp;</th>
	  <#if owner><th class="thtop" nowrap="nowrap" colspan="2">&nbsp;${I18n.getMessage("Action")}&nbsp;</th></#if>
	</tr>

	<#if bookmarks.size() == 0>
		<tr>
			<td align="center" colspan="3">
				<span class="gen">${I18n.getMessage("Bookmarks.empty")}</span>
			</td>
		</tr>
	</#if>


	<#list bookmarks as b> 
	    <#if b_index % 2 == 0>
			<#assign color = "bg2">
		<#else>
			<#assign color = "bg1">
		</#if>
		<#if b.relationType == topicType>
			<#if b.isPublicVisible() || owner>
				<tr align="center" class="row ${color}">	
					<td align="left">
						<span>
						<a href="${JForumContext.encodeURL("/posts/list/${b.relationId}")}" >${b.title}</a>
						</span>
					</td>
					<td><span class="gen"><#if (b.description?default("")?length > 0)>${b.description}</#if></span></td>
					<#if owner><td><span ><a href="javascript:addBookmark(2, ${b.relationId});">${I18n.getMessage("Edit")}</a></span></td></#if>
					<#if owner><td><span><a href="javascript:confirmDelete(${b.id})">${I18n.getMessage("Delete")}</a></span></td></#if>
				</tr>


			</#if>
		</#if>
	</#list>

</table>

<#if thisPage?exists>
	<div class="pagination">
						<#assign paginationLinks>
							<@pagination.doPagination "list", -1/>
						</#assign>

						${paginationLinks}
   	</div>
</#if>
<#include "bottom.htm"/>